﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ducu.SRV.ServiceInteface
{
    public interface IPlanService
    {
        int New(Ducu.SRV.ViewModel.Plan.NewModel model, IEnumerable<int> daysInWeek);
        void Edit(ViewModel.Plan.EditorTemplates._NewOrEditModel model, int planId);
        JoinResult Join(int planId);
        void Stop(int id);

        int GetCount(
            bool due,
            bool expire,
            bool full,
            string my,
            string keyword,
            int? userId);

        Ducu.SRV.ViewModel.Plan.IndexModel Get(
            bool due,
            bool expire,
            bool full,
            string my, 
            string keyword, 
            int? userId,
            GLB.Global.Pager pager);

        ViewModel.Shared._NeedFulfilModel GetNeedFulfil();
        ViewModel.Plan.EditModel GetEdit(int planId);
        ViewModel.Plan.ShowModel GetShow(int planId);
        ViewModel.Plan.Shared._ShowItemBodyModel GetShowItemBody(int planId);
        ViewModel.Shared._NeedAcceptModel GetNeedAccept();

        bool IsCurrentUserVower(int id);
        bool CanLeave(int planId, DateTime date);
    }

    public enum JoinResult
    {
        Succeed = 0,
        FailForFull = 1
    }
}
